
import React from 'react';
import agent from 'server';
import ICapability from 'components/capability/interfaces/ICapability';
import Controller from 'Controller';

/** 恢复 */
export const recover: ICapability<undefined> = {
    id: 'recover',
    title: '恢复',
    useExpand: () => {
        const threeController = Controller.instance.useMemo(s => s.threeController, []);

        const onClick = React.useCallback(async () => {
            threeController.recover((await agent.get('/api/project/ldte').over()).body);
        }, [threeController]);

        return {
            onClick,
        }
    }
}